<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../../js/jquery-3.4.1.js"></script>
</head>
<body>
<input type="text" id="inputTest" />
<button id="getValue">获取值</button>
</body>
<script>

    $(function () {
        buttonInit();
    });

    function buttonInit() {
        $('#getValue').click(function () {
            console.log("-> ", $("#inputTest").val() === null)
        });
    }

</script>
</html>